Numbers, Arithmetic and Basic Algebra
Natural Numbers
The positive integers are called natural numbers. These numbers can be added, multiplied together and so forth.
Notation:
Subtraction and division are not defined on these numbers.
An arbitrary element of is most commonly denoted by , or , but any symbol can be used.
Details
The set of positive integers is usually denoted by , i.e. and is called the set of natural numbers. In some cases the number zero is included as a natural number, but here we will use the symbol to denote the integers 0, 1, 2 and up.
Within this set of numbers it is possible to add and multiply numbers together. Arithmetic operations are denoted by for addition and (or ) for multiplication. A natural number can also be raised to the power of a natural number, e.g. or in general ( times).
When stating general properties of the natural numbers one needs to use symbols to indicate that the property holds for an arbitrary number. It is not enough to just write the property for a few numbers. For example, to declare that one can interchange numbers in a sum, it is not enough to say , but one must explicitly state "the addition operator has the property that any two natural numbers, satisfy ".
An arbitrary element of is most commonly denoted by ,or , but any symbol, , can be used.
Several rules of arithmetic apply (some by definition, others can be derived) such as
Subtraction and division are not generally defined. In addition, we define one integer, , to the power of another, , to mean multiplied by itself times: .
The power is an operator just like addition and multiplication, and is defined to have higher priority than the other two.
Examples
If we have and and want to evaluate:
then we replace the values of x and y in the expression, and evaluate it, taking care to observe the correct order of operations:
Starting With R
Download R from the R website: http://www.r-project.org/
Look at on-line information on R, and take the tutor-web R tutorial: http://tutor-web.net/stats/stats240.1
Simple R commands:
Assignment:
x <- 2
Arithmetic:
2*5+4
Details
To assign values to a variable in R one can use <-
or =
.
however, these are NOT equivalent.
Using the equals sign is confusing and therefore not recommended.
Examples
Assigning values to a variable:
x <- 2
y <- 3
z <- x+y
Type the name, i.e. z
, to view the assigned value.
> z
[1] 5
The Integers
The set of positive and negative integers:
Details
The set of all integers is denoted by , i.e.
Note that within this set it is possible to subtract as well as add and multiply. Within this set we cannot, however, in general, perform division.
When preforming multiple mathematical operations within the same equation, i.e. , there is a conventional order for which the operations must be performed.
The conventional order of operations for equations with multiple mathematical operations is referred to as an operator precedence.
Examples
To compute start by multiplying and then subtracting:
To compute
we first note that the parentheses (brackets) imply a precedence; anything inside brackets should be evaluated first. Thus, we first add to and then we subtract that from :
Note that the answer is a negative number.
Simple arithmetic in R is easily done at the command prompt:
> 79-8*3
[1] 55
> 15-(24+36)
[1] -45
Rational Numbers
Rational numbers are fractions denoted , where and are integers. We can simplify fractions if the numerator and denominator contain common terms.
Details
Rational numbers are fractions denoted , where and are integers. The set of all rational numbers is usually denoted .
Note that every integer is a rational number (obtained by taking ).
We can simplify fractions if the numerator and denominator contain common terms. When the rationals are ordered on to a line there are points missing, i.e. there are "gaps"; for example there is no rational number such that .
Examples
The rational numbers can be put in order along a line as in the figure.
As an elaborate example of a fraction, consider the evaluation of the quantity:
Evaluate:
Solution: We can either start by calculating the numerator:
or the denominator:
Here we choose to start with the numerator. The first step is to make the two fractions in the numerator have a common denominator.
We can either find the least common denominator or use the product of the two denominators.
Here they are the same number, 15
.
So the first step is:
Now it is possible to add the two fractions, which is the second step:
Next, the same process has to be performed for the original denominator.
With the same method (LCM - least common multiple) we get:
Then the total answer is:
We can see that in the last step of the equation, the factor has been simplified. To do this we use factoring. Here we obtain:
We can now remove , or the multiplier, as it is on both sides of the fraction. So we have:
In step 1 above we used Cross-Multiplication.
Definition: Cross-Multiplication is when we multiple the numerator by the reciprocal of the denominator.
So in this case we rewrite
or
as
As you can see all we are doing is turning
upside down; and multiplying it with
This gives
In some cases it is possible to draw a square root of a fraction , i.e. find a number such that . The square root is denoted .
Consider the expression
To evaluate this expression, first consider separately the two parts on each side of the plus symbol.
The first part is
and the second part is
In addition, by definition of root,
First part:
Second part:
Finally, add the first part and the second part:
Consider the following fraction example, to be solved step by step:
First we need to be aware of operator precedence, sometimes called BODMAS (brackets, multiplication/division, then addition/subtraction).
After solving the bracket we can proceed with adding
to
as there is no other action left for the nominator of the main fraction.
So:
When adding fractions together we first have to find a common denominator, in this case 12
would work as
So we multiply both the numerator and the denominator of that fraction by 6
and then add the two numerators of the fractions together, keeping the same denominator.
Now we have the top half of the fraction solved.
We then proceed with dividing the two fractions of the bottom half.
When dividing fractions we use the so called cross multiplication technique.
This arithmetic trick is derived from the fact that if you divide a fraction by its duplicate you get 1
.
If you multiple a fraction by its reciprocal (it's reverse) you also get 1
.
Like so:
and
These functions always provide the same result and therefore we can turn the fraction we are dividing by upside down and multiply it to the other fraction as that is usually much easier.
We can therefore rewrite
as
We've now solved both halves of the original fraction and can therefore proceed to solve it, again with the cross multiplication technique as fractions are after all just divisions:
Now
is a pretty bad looking fraction and we'd preferably like to simplify it. To do this we use factoring.
Definition: Factoring essentially means to break a number done into its smallest factors or multipliable prime numbers.
In this case we get
These are the smallest prime numbers that can multiply together into 174
and 120
respectively.
A way of doing this in your head is by first dividing both numbers (174
and 120
) by 2
.
Which gives us:
and then dividing those numbers (87
and 60
) by 3
, since they can't be divided by 2
.
Dividing by 3
gives you
which is a lot nicer than
The reasoning behind this factoring simplification is that we can remove multipliers if they are on both sides of a fraction.
This is because the result of a fraction where the numerator and the denominator are the same is always 1
.
Like so:
or
or
The final answer therefore is
The Real Line
Some obvious numbers are not fractions. The set of numbers making up the real line is denoted by the symbol .
Figure: The diagonal of a rectangle with unit side lengths of . Note that is not a fraction.
Details
Some obvious numbers, which commonly occur, are not fractions. These are in between the rational numbers (fractions) on the number line. Filling in the missing points to obtain a continuum results in the set of real numbers.
Denoted by the entire set of real numbers which corresponds to filling in the missing pieces of the number line, so to speak.
Examples
If is the circumference of a circle and is the diameter and we define then is not a fraction.
One example of a non-fraction is the number e
(Euler's number) which can be defined by:
If you have a right triangle with unit side length, what is the length of its hypotenuse and what class of numbers does it belong to?
An isosceles triangle is defined as having adjacent and opposite sides of same length, connected by a angle.
Unit side length of these, refers to a side length of 1
.
As we have a angle, we can use Pythagoras' theorem:
With
So with
We take the square root to get :
Now that we answered the first part of the question, it needs to be defined, which class of number belongs to. is an irrational number, and belongs thereby to the set of real numbers . Real numbers can be imagined as points on an infinitely long line, which is also called the real line.